import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class 差分 {
	static int N = 100010;
	static int[] arr = new int[N];
	static int[] b = new int[N];
	
	public static void main(String[] args) throws IOException {
		//���->ģ��
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
		String[] s1 = in.readLine().split(" ");
		int n = Integer.parseInt(s1[0]);
		int m = Integer.parseInt(s1[1]);
		String[] s2 = in.readLine().split(" ");
		for(int i=1;i<=n;i++) arr[i] = Integer.parseInt(s2[i-1]);
		for(int i=1;i<=n;i++) insert(i,i,arr[i]);
		
		while(m-- >0) {
			String[] s3 = in.readLine().split(" ");
			int l = Integer.parseInt(s3[0]);
			int r = Integer.parseInt(s3[1]);
			int c = Integer.parseInt(s3[2]);
			insert(l,r,c);
		}
		
		for(int i=1;i<=n;i++) arr[i]=arr[i-1]+b[i];
		for(int i=1;i<=n;i++) System.out.print(arr[i]+" ");
	}

	private static void insert(int l,int r ,int x) {
			 b[l]+=x;
			 b[r+1]-=x;
	}
	
	

}
